/**
*
* @Depends ruleMgr.js
*/
ksg.bizrule.bizRules["getAlfArticles"] = function (options, onSuccess, onError) {
	var d = { "user": options.user, "pass": options.pass, "server": options.server, "type": options.type };
	var srvUrl = 'genericproxy.php?url=' + options.server + '/tools/application/webservice/jsonservice.php&full_headers=0&full_status=0&send_cookies=0&user_agent=0&mode=0&HTTP_X_REQUESTED_WITH=1'
	d.display = 'list';
	$.ajax({
		type: 'POST',
		crossDomain: true,
		dataType: 'text',
		data: 'user=' + options.user + '&pass=' + options.pass + '&type=' + options.type,
		url: srvUrl,
		success: function (data) {
			var str = JSON.parse(data.substring(data.indexOf('{')));
			var con = str.contents;
			con = con.substring(con.indexOf('{'));
			var jsond = JSON.parse(con);
			var bizObjs = new Array();
			for (var kn in jsond.blogs) 
				bizObjs.push(jsond.blogs[kn]);
			var response = { response: { bizObjs: bizObjs, total: jsond.total, type: d.type, bizObjType: 'alfresco'} };

			onSuccess(response);
		},
		error: function (jqXHR, textStatus, errorThrown) {
			onError(errorThrown);
		}
	});



};

ksg.bizrule.bizRules["getAlfArticleDetails"] = function (options) {
	/*
	$.ajax({
		contentType: "application/json; charset=utf-8",
		url: "http://alfresco.syrinxcs.com:8080/alfresco/service/api/blog/post/node/workspace/SpacesStore/eb2c4088-aa06-43d9-92be-eb32df00c37d",
		username: "admin",
		password: "admin",
		statusCode: {
			404: function () {
				alert('page request error!');
			}
		},
		success: function (data, textStatus, jqXHR) {
			alert($.param(data));
		},
		error: function (info, d, ex) {
			alert($.param(info));
		}
	});*/
};



